import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';

class HomeSwipe extends StatelessWidget {
 HomeSwipe({super.key,required this.swipeList});

  List swipeList = [];

  @override
  Widget build(BuildContext context){
    return CarouselSlider(
      items: swipeList.map((item){
        return Image.network(item["imgUrl"]);
      }).toList(),
      options: CarouselOptions(
        viewportFraction: 1,//图片是否缩放
        aspectRatio: 375/185,//高宽比，设置后没有padding
        autoPlay: true,//自动播放
        autoPlayInterval: Duration(seconds: 3)//播放间隔
      ));
  }
}
